home *** CD-ROM | disk | FTP | other *** search
-
- /* SV_SuperVisor.c
- - SuperVising (global exit) Functions for ST-Support -
- (c) 1990-94 by Andreas R. Kleinert
- Last changes : 17.07.1994
- */
-
- #include "spobject.h"
-
- struct SPObjectHandle * __saveds __asm SPO_AllocHandle( register __a1 APTR future_a1);
- void __saveds __asm SPO_FreeHandle( register __a1 struct SPObjectHandle *SPObjectHandle_a1);
- void __saveds __asm SPO_StopReplay( register __a1 struct SPObjectHandle *SPObjectHandle_a1);
- void __saveds __asm SPO_FreeResources( register __a1 struct SPObjectHandle *SPObjectHandle_a1);
-
- /* *************************************************** */
- /* * * */
- /* * SPO_AllocHandle : Free SPObjectHandle and more * */
- /* * * */
- /* *************************************************** */
-
- struct SPObjectHandle * __saveds __asm SPO_AllocHandle( register __a1 APTR future_a1)
- {
- APTR future = future_a1;
- struct SPObjectHandle *handle;
-
- handle = (APTR) AllocVec(sizeof(struct SPObjectHandle), (MEMF_CLEAR|MEMF_PUBLIC));
- if(handle)
- {
- handle->ah_Type = SP_SUBTYPE_NONE;
- handle->ah_WriteMode = SP_SUBTYPE_NONE;
- handle->ah_Medium = SPO_MEDIUM_DISK; /* default */
- }
-
- return(handle);
- }
-
- /* *************************************************** */
- /* * * */
- /* * SPO_FreeHandle : Free SPObjectHandle and more * */
- /* * * */
- /* *************************************************** */
-
- void __saveds __asm SPO_FreeHandle( register __a1 struct SPObjectHandle *SPObjectHandle_a1)
- {
- struct SPObjectHandle *SPObjectHandle = SPObjectHandle_a1;
-
- if(SPObjectHandle->ah_STModule)
- {
- ST_Stop();
-
- ST_UnLoadModule();
-
- ST_Module = N;
- ST_Len = N;
- }
-
- if(SPObjectHandle->ah_SampleList) SPLI_FreeSampleList(SPObjectHandle->ah_SampleList);
-
- SPO_FreeResources(SPObjectHandle);
-
- FreeVec(SPObjectHandle);
- }
-
- /* *************************************************** */
- /* * * */
- /* * SPO_StopReplay : ... * */
- /* * * */
- /* *************************************************** */
-
- void __saveds __asm SPO_StopReplay( register __a1 struct SPObjectHandle *SPObjectHandle_a1)
- {
- struct SPObjectHandle *SPObjectHandle = SPObjectHandle_a1;
-
- if(SPObjectHandle) if(SPObjectHandle->ah_STModule) ST_Stop();
- }
-
- /* *************************************************** */
- /* * * */
- /* * SPO_FreeResources : Free Memory and more * */
- /* * * */
- /* *************************************************** */
-
- void __saveds __asm SPO_FreeResources( register __a1 struct SPObjectHandle *SPObjectHandle_a1)
- {
- struct SPObjectHandle *SPObjectHandle = SPObjectHandle_a1;
-
- if(SPObjectHandle)
- {
- if(SPObjectHandle->ah_filehandle_source) Close(SPObjectHandle->ah_filehandle_source);
- if(SPObjectHandle->ah_filehandle_dest) Close(SPObjectHandle->ah_filehandle_dest);
- if(SPObjectHandle->ah_ramhandle) AIM_FreeMemList(SPObjectHandle->ah_ramhandle);
-
- SPObjectHandle->ah_filehandle_source = N;
- SPObjectHandle->ah_filehandle_dest = N;
- SPObjectHandle->ah_ramhandle = N;
- }
- }
-